<template>
    <view>
        <view class="banner">
            <swiper class="swiper" :indicator-dots="true" indicator-color="rgba(253, 255, 251, .3)" indicator-active-color="#fbfff9" circular :autoplay="true" :interval="3500" :duration="1500">
                <swiper-item class="swiperItem" v-for="(item, index) in Bannel" :key="index">
                    <image :src="$imgUrls(item.img)" mode="aspectFill" class="wh"></image>
                </swiper-item>
            </swiper>
        </view>
    </view>
</template>

<script>
    import { mapMutations } from 'vuex';
    export default {
        data() {
            return {
                Bannel: []
            };
        },
        created() {
            this.getConfig();
        },
        methods: {
            ...mapMutations(['Zunyi']),
            getConfig() {
                this.$http
                    .get({
                        url: '/orderRepairApi/getConfig'
                    })
                    .then((res) => {
                        if (res.code != 200) return this.$Toast(res.msg);
                        const result = res.data;
                        this.Bannel = result.banner || [];
                        if (result.tips) this.Zunyi({ tips: result.tips });
                    });
            }
        }
    };
</script>

<style lang="scss" scoped>
    .banner {
        width: 710rpx;
        height: 330rpx;
        margin: 30rpx auto 0;

        .swiper {
            width: 100%;
            height: 100%;
            border-radius: 10rpx;
            overflow: hidden;
            .swiperItem {
                width: 100%;
                height: 100%;
            }
        }
    }
</style>
